home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / tpballs.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  3KB  |  134 lines

  1. /* TPBalls.rexx -- Draw Balls Background        */
  2. /* By Bob Caron © 1995 NewTek Inc.              */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. screen=0
  11. if inclipname="" & outclipname="" then screen=1
  12. if screen=1 then do
  13.    startfield=1
  14.    endfield=1
  15.    outclipname="Test"
  16.    end
  17.  
  18. IFFBaseName=OutClipName
  19.  
  20. if ~show('l','rexxsupport.library') then do
  21.   if ~addlib('rexxsupport.library',0,-30,34) then do
  22.     exit
  23.   end
  24. end
  25.  
  26.  
  27. /* Reset Paint */
  28. 'Pmcl'
  29. 'Pot0' 0
  30. 'Pot1' 0
  31. 'Poth' $8000
  32. 'Potv' $8000
  33. 'Spoh' $8000
  34. 'Spov'
  35. /* End Of Reset*/
  36.  
  37.  
  38. PageWide=752
  39. PageHigh=480
  40. dots=0
  41. XWin = 100
  42. YWin = 40
  43. Clear = d2c(12)
  44. nv = ''
  45. cr = '0a'x
  46. call getfontsize
  47.  
  48. wid = width*48
  49. hei = theight+height*10
  50.  
  51. if screen=0 then do
  52.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/TPBalls V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  53.        exit
  54.    end
  55. end
  56.  
  57. do Frame = StartField to (StartField+(EndField-StartField)/2)
  58.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  59.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  60.   call filter()                    /* Do The filter Thing...                 */
  61.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  62.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  63.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  64.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  65.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  66.   end
  67. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  68. exit
  69.  
  70. filter:  /* Do a filter */
  71.  
  72. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  73.  
  74. 'Hvof'          /* Set radial gradient blend off */
  75. 'Hvar'
  76. 'Potv' $4000    /* Set hotspot 1/4 from top */
  77. 'Poth' $4000    /* Set hotspot 1/4 from left */
  78. 'Rang'
  79. 'Drci'
  80. 'Flon'
  81. do y=20 to 460 by 40
  82.   do x=36 to 720 by 40
  83.     'Pend' x y
  84.     'Penu' x+20 y
  85.   end
  86. end
  87.  
  88. return
  89.  
  90.  
  91. OpenWindow:
  92. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  93.   pdots="...."
  94.   dots=dots+1
  95.   if dots>4 then dots=1
  96.   call writech('Window',Clear||nv||cr)
  97.   call writech('Window','Current Source Clip ['InClipName']'cr)
  98.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  99.   call writech('Window',''cr)
  100.   call writech('Window','Current Frame: 'Frame/2''cr)
  101.   call writech('Window','    End Frame:'EndFrame/2''cr)
  102.   call writech('Window',''cr)
  103.   call writech('Window','Processing'right(pdots,dots)||cr)
  104.  
  105. return
  106.  
  107.  
  108. getfontsize:
  109.  
  110. if open('font','env:sys/font.prefs','R') then do
  111.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  112.    call close('font')
  113.    font = substr(font,index(font,'FONT')+4)
  114.    font = substr(font,index(font,'FONT')+4)
  115.    height = c2d(substr(font,29,2))
  116.    tfont = substr(font,index(font,'FONT')+4)
  117.    theight = c2d(substr(tfont,29,2))
  118.    font = substr(font,33)
  119.    font = left(font,index(font,d2c(0))-1-5)
  120.    if open('font','FONTS:'font'/'height,'R') then do
  121.       width = c2d(right(readch('font',116),2))
  122.       call close('font')
  123.   end
  124.   else if height=9 then width = 10
  125.                    else width = 8
  126. end
  127.   else do
  128.   theight = 8
  129.   height = 8
  130.   width = 8
  131. end
  132.  
  133. return
  134.